<template>
       <template v-for="item in menuList" >
         <el-sub-menu :index="item.link" v-if="item.children&&item.children.length>0" >
          <template #title>{{ item.title }}</template>
            <SubMenu v-if="item.children" :menuList = "item.children"></SubMenu>
          </el-sub-menu>
          <el-menu-item :index="item.link " v-else  >{{item.title}}</el-menu-item>
     </template>
</template>
<script setup lang='ts'>
interface MenuList {link:string,name:string,title:string,children:MenuList[]}
defineProps<{menuList:MenuList[]}>()
</script>
<style scoped>

</style>